import Vue from 'vue'
import Router from 'vue-router'

import moduleRoutes from './module.js'
Vue.use(Router)
const routes = [{
  path: '/',
  component: (resolve) => {
    require(['../views/CommonView.vue'], resolve)
  },
  redirect: '/setting',
  children: [...moduleRoutes]
},
{
  path: '/login',
  component: (resolve) => {
    require(['../views/Login/Login.vue'], resolve)
  }
},
{
  path: '*',
  component: {
    render(h) {
      return h('div', {
        staticClass: 'flex flex-main-center',
        attrs: {
          style: 'height:100vh;width:100vw;background: url(./static/image/404/404.png) center center no-repeat; background-size: cover;'
        }
      })
    }
  }
}]
var router = new Router({
  mode: 'history',
  routes
})

export default router